package com.zxy.ziems.server.scene.pojo.dto;

import com.zxy.ziems.common.validation.InEnum;
import com.zxy.ziems.server.scene.pojo.bo.Frame;
import com.zxy.ziems.server.scene.pojo.enums.SceneType;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Null;
import lombok.Data;

import java.math.BigDecimal;

/**
 * @author chdzq
 * @create 2023/3/21
 */
@Data
public class SceneDTO {

    /**
     * 主键
     */
    @Null(message = "新增场景，ID必须为空", groups = Add.class)
    @NotBlank(message = "场景ID不能为空", groups = {Update.class, Select.class})
    private String id;

    /**
     * 父节点
     */
    private String parentId;

    /**
     * 场景编码
     */
    @NotBlank(message = "场景编码不能为空", groups = {Add.class, Update.class, PageSelect.class})
    private String code;

    /**
     * 场景名称
     */
    @NotBlank(message = "场景名称不能为空", groups = {Add.class, Update.class})
    private String name;

    /**
     * 场景类型 1楼栋 2楼层
     *
     * @see SceneType
     */
    @NotNull(message = "场景类型不能为空", groups = {Add.class, Update.class})
    @InEnum(value = SceneType.class, groups = {Add.class, Update.class})
    private Integer type;

    /**
     * 文件id
     */
    private String fileId;

    /**
     * 场景宽度
     */
    private BigDecimal width = BigDecimal.ZERO;

    /**
     * 场景高度
     */
    private BigDecimal height = BigDecimal.ZERO;

    /**
     * 场景坐标 默认不给 就是 {x:0, y:0, w:width, h:height, z:0}
     */
    private Frame frame;

    /**
     * 序号
     */
    private Integer sort;


    public interface Add {
    }

    public interface Update {
    }

    public interface Select {
    }

    public interface PageSelect {
    }

}
